<?php

namespace common\model;

use think\model\RelationModel;

class RuleModel extends RelationModel
{

    //自动验证
    protected $_validate = [
        ['ptype', '0,255', '', self::EXISTS_VALIDATE, 'length'],
        ['v0', '0,255', '', self::EXISTS_VALIDATE, 'length'],
        ['v1', '0,255', '', self::EXISTS_VALIDATE, 'length'],
        ['v2', '0,255', '', self::EXISTS_VALIDATE, 'length'],
        ['v3', '0,255', '', self::EXISTS_VALIDATE, 'length'],
        ['v4', '0,255', '', self::EXISTS_VALIDATE, 'length'],
        ['v5', '0,255', '', self::EXISTS_VALIDATE, 'length'],
        ['v0,v1,v2,v3', '', 'Privilege policy already exists.', self::MUST_VALIDATE, 'unique', self::MODEL_BOTH]
    ];

    //自动完成
    protected $_auto = [
        ['created', 'time', self::MODEL_INSERT, 'function'],
        ['uuid', 'create_uuid', self::MODEL_INSERT, 'function']
    ];
}
